package com.invoicing.Service;

import com.invoicing.dao.VendMapper;
import com.invoicing.dao.VendorItemMapper;
import com.invoicing.entity.VendorItem;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class VenditemService {
    @Autowired
    private VendorItemMapper vendorItemMapper;

    public int insert(List<VendorItem> vendorItemList){
        return vendorItemMapper.insertVendorItem(vendorItemList);
    }

    public List<VendorItem> listAll(int id){return vendorItemMapper.selectByVendId(id);}

    public List<VendorItem> selectByDate(Date date){return vendorItemMapper.selectByDate(date);}

    public float allVendCost(int id, Date start,Date end){return vendorItemMapper.allVendCost(id,start,end);}

    public int allVendCount(int id){return vendorItemMapper.allVendCount(id);}
}
